(add-to-list 'muse-html-markup-tags
	     '("img" t t t leto-muse-imgtag))

(defun leto-muse-imgtag (beg end attrs)
  (let ((source (or (cdr (assoc "src" attrs)) "nil"))
	(align (or (cdr (assoc "align" attrs)) "right"))
;;	(url (or (cdr (assoc "href" attrs)) "./"))
	(text (delete-and-extract-region beg end))
	)
    (insert 
     (concat "<div class=\"pic\" style=\""
	     (if (string-equal "center" align)
		 "text-align: center"
	       (if (or (string-equal "left" align) 
		       (string-equal "right" align))
		   (concat "float: " align))
	       "float: right")		; if none of above align right;
	     ";\">\n"
	     "  <img src=\"" source "\" "
	     (if (> (string-width text) 0)
		 (concat "alt=\"" text "\" /><br />\n"
			 "  <label class=\"image-caption\">\n"
			 "    " text "\n"
			 "  </label>\n")
	       (concat "alt=\"image add by muse-imgtag\" />\n")
	       )
	     "</div><!-- pic -->"	     
	     ))
    (muse-publish-mark-read-only beg (point))))